<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
		<base href="<%=basePath%>">

		<title>注册页面</title>

		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<link href="css/style.css" rel="stylesheet" type="text/css" />
		<link href="css/main.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="js/jquery.min.js"></script>
		<script type="text/javascript" src="js/common.js"></script>

		<script type="text/javascript">
		function judge(){
		var usercheck=document.getElementById("usercheck").value;
		if(usercheck.length<3||usercheck.length>20){
		alert("用户名不符合格式!");
		}else{
		$.ajax({
		url:"checkedError.do",
		type:"post",
		dataType:"json",
		data:'usercheck='+usercheck,
		timeout: 1000,
		error:function(){  
        document.write("<h1>Error</h1>");
        alert("Error"); 
      },  
        success:function(jsonContent){
        var tc = jsonContent.returnmsg;
        alert(tc);
       }
		});
		}
		}
		</script>

	</head>

	<body>
		<div id="layout">

			<div id="login_header">
				<h1 class="login_header_text">
					<a href="index.do" title="返回首页">校园豆豆</a>
				</h1>
			</div>

			<div id="register_main">

				<div id="register_left">
					<form action="register!getInfo.do" method="POST" id="autoForm">
						<table width="539" height="330" border="0">
							<tr>
								<td>
									<table width="539" height="330" border="0">
										<tr>
											<td width="89" height="39">
												&nbsp;&nbsp;&nbsp;类&nbsp;型:
											</td>
											<td width="156">
												<input type="radio" checked="checked" value="0"
													name="userType" />
												会员 &nbsp;&nbsp;
												<input type="radio" value="1" name="userType" />
												商家
											</td>
											<td width="194">
												&nbsp;
											</td>
											<td width="82">
												&nbsp;
											</td>
										</tr>
										<tr>
											<td height="50">
												账&nbsp;户&nbsp;名:
											</td>
											<td>
												<input type="text" class="input2" name="username" size="20"
													id="usercheck" onblur="judge()" />
											</td>
											<td colspan="2" id="userInfo">
												<span class="return_message">&nbsp;*3-20
													字符(由数字,字母和下划线组成)</span>
											</td>
										</tr>
										<tr>
											<td height="50">
												登录密码:
											</td>
											<td>
												<input type="password" class="input2" name="password"
													size="20" />
											</td>
											<td colspan="2">
												<span class="return_message"> &nbsp;*6-20
													字符，建议使用字母加数字或符号的组合密码</span>
											</td>
										</tr>
										<tr>
											<td height="50">
												确认密码:
											</td>
											<td>
												<input type="password" class="input2" name="confpassword"
													size="20" />
											</td>
											<td colspan="2">
												<span class="return_message"> &nbsp;*再次确认您的密码</span>
											</td>
										</tr>
										<tr>
											<td height="50">
												&nbsp;&nbsp;&nbsp;Email:
											</td>
											<td>
												<input type="text" class="input2" name="email" size="20" />
											</td>
											<td colspan="2">
												<span class="return_message">&nbsp;*请填写您常用的电子邮箱以方便日后取回密码</span>
											</td>
										</tr>
										<tr>
											<td height="50">
												&nbsp;&nbsp;验证码:
											</td>
											<td>
												<input type="text" class="input3" name="auth" size="4" />
												<img hspace=2 src="loginAuth.do">
											</td>
											<td colspan="2">
												&nbsp;


											</td>
										</tr>
										<tr>
											<td></td>
											<td colspan="3">
												<span class="return_message"><s:property
														value="returnmsg" /> </span>
											</td>
										</tr>
										<tr>
											<td height="50">
												&nbsp;


											</td>
											<td>
												<input type="submit" value="  注册  " />
											</td>
											<td>
												&nbsp;


											</td>
											<td>
												&nbsp;


											</td>
										</tr>
									</table>
								</td>
							</tr>
						</table>
					</form>
				</div>
				<div id="register_right">
					填充图
				</div>

			</div>

			<!-- footer尾部 -->
			<%@ include file="/WEB-INF/common/footer/footer.jsp"%>
		</div>
	</body>
</html>

